function CE.Knight(arg1, goat2)
--arg1 = "v1" or "v2" for debugging
--goat2: "0" = Buffs, "1" = Melee, "2" = Ranged or instant , 3 = Food and potions,
--goat2: "4" = Boss Burst buffs, "pvp" = PvP combo, "aoe" = aoe skils
    local Skill = {}
    local Skill2 = {}
    local i = 0
    
    -- Player and target status.
    local combat = GetPlayerCombatState()
    local enemy = UnitCanAttack("player","target")
	local phealth = PctH("player")
    local thealth = PctH("target")
	local playerHP = (UnitHealth("player"))
	local targetHP = UnitHealth("target")
	local pctEB1 = PctM("player")
	local pctEB2 = PctS("player")
    local EnergyBar1 = UnitMana("player")
	local EnergyBar2 = UnitSkill("player")
    local tbuffs = BuffList("target")
    local pbuffs = BuffList("player")
    local tDead = UnitIsDeadOrGhost("target")
    --local behind = (not UnitIsUnit("player", "targettarget"))
	--local behind1 = IsUsableAction(9) -- # is your blind spot spell slot number
	--local melee = GetActionUsable(45) -- # is your melee range spell slot number
	--local a1,a2,a3,a4,a5,ASon = GetActionInfo(4)  -- # is your Autoshot slot number
	--local PsiPoints, PsiStatus = GetSoulPoint()
	local ammo = (GetEquipSlotInfo(10) ~= nil)
	local zoneid = (GetZoneID() % 1000)
    local SeigeWar = (zoneid == 402) -- The "Seige War" Zone
    local boss = UnitSex("target") >= 3
    local elite = UnitSex("target") == 2
    local party = GetNumPartyMembers() >= 2
	local PetExists = UnitExists("playerpet") 
	local MobName = UnitName("target")
	local bowslot = GetEquipSlotInfo(11) == "interface\\CharacterFrame\\Equipment-RangedSlot" -- check if you have bow equiped
	
	-- Food And pot Dropdown menu locales
	local Rebuff = tonumber(CE_Settings[CE.playerName]["Tab3"]["Rebuff"])
	local HpDef = tonumber(CE_Settings[CE.playerName]["Tab3"]["HpDef"])
	local HpDef_Use = (not pbuffs[CE.BuffCheck("HpDef")] or pbuffs[CE.BuffCheck("HpDef")].time <= Rebuff)
	local HpDef_Check = CE_Settings[CE.playerName]["Tab3"]["HpDef_Check"]
	local DmgFood = tonumber(CE_Settings[CE.playerName]["Tab3"]["DmgFood"])
	local DmgFood_Use = (not pbuffs[CE.BuffCheck("DmgFood")] or pbuffs[CE.BuffCheck("DmgFood")].time <= Rebuff)
	local DmgFood_Check = CE_Settings[CE.playerName]["Tab3"]["DmgFood_Check"]
	local SpeedPot = tonumber(CE_Settings[CE.playerName]["Tab3"]["SpeedPot"])
	local SpeedPot_Use = not pbuffs[CE.BuffCheck("SpeedPot")]
	local SpeedPot_Check = CE_Settings[CE.playerName]["Tab3"]["SpeedPot_Check"]
	local CritFood = tonumber(CE_Settings[CE.playerName]["Tab3"]["CritFood"])
	local CritFood_Use = not pbuffs[CE.BuffCheck("CritFood")]
	local CritFood_Check = CE_Settings[CE.playerName]["Tab3"]["CritFood_Check"]
	local CritPot = tonumber(CE_Settings[CE.playerName]["Tab3"]["CritPot"])
	local CritPot_Use = not pbuffs[CE.BuffCheck("CritPot")]
	local CritPot_Check = CE_Settings[CE.playerName]["Tab3"]["CritPot_Check"]
	local Sigil = tonumber(CE_Settings[CE.playerName]["Tab3"]["Sigil"])
	local Sigil_Use = not pbuffs[CE.BuffCheck("Sigil")]
	local Sigil_Check = CE_Settings[CE.playerName]["Tab3"]["Sigil_Check"]
	local ISFood =  tonumber(CE_Settings[CE.playerName]["Tab3"]["ItemShop"])
	local ISFood_Use = (not pbuffs[CE.BuffCheck("ItemShop")] or pbuffs[CE.BuffCheck("ItemShop")].time <= Rebuff)
	local ISFood_Check = CE_Settings[CE.playerName]["Tab3"]["ItemShop_Check"]
	local Realgar = CE_Settings[CE.playerName]["BurstSlim"]["Realgar"]
	local Realgar_Use = (not pbuffs[501616] or pbuffs[501616].time <= Rebuff)
	local Hero = CE_Settings[CE.playerName]["BurstSlim"]["Hero_Pot"]
	local Hero_Use = (not pbuffs[501337] or pbuffs[501337].time <= Rebuff)
	local LongBuff = CE_Settings[CE.playerName]["BurstSlim"]["5MinBuff"]
	
   --Silence, Substitute and Protect Logic
	local silenceList = CE.silenceList
	local protectList = CE.protectList
	local subList = CE.subList
    local tSpell,tTime,tElapsed = UnitCastingTime("target")
    local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
    local protect = tSpell and protectList[tSpell] and ((tTime - tElapsed) > 0.1)
    local subThis = tSpell and subList[tSpell] and ((tTime - tElapsed) > 0.1)
	
	--Determine Class-Combo
    mainClass, subClass = UnitClassToken( "player" )
	
    --Begin Player Skill Sequences
        --Rogue = THIEF, Scout = RANGER, Mage = MAGE, Knight = KNIGHT, 
        --Druid = DRUID, Priest = AUGUR, Warden = WARDEN, Warrior = WARRIOR
		--Champion = PSYRON, Warlock = HARPSYN
	if mainClass == "KNIGHT" then
		------------------
		-- KNIGHT/ROGUE --
		------------------
		if subClass == "THIEF" then
			--goat2: 0 = Buffs, 1 = Melee, 2 = Ranged combat, 3 = Cooldowns & Potions, 4 = Burning Cooldowns
			if (goat2 == "0") then -- Long bufs
				Skill = {
					{ name = "Enhanced Armor",						use = (not pbuffs["Enhanced Armor"]) },
					{ name = "ItemID: 207200",		use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
						}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
				
			if ((enemy) and (goat2 == "1")) then -- instant skilovi
				Skill2 = {
					{ name = "Enhanced Armor",						use = (not pbuffs["Enhanced Armor"]) },
					{ name = "Holy Seal",                      		use = (not pbuffs["Holy Seal"]) },
					{ name = "Crazy Blades",                        use = (not pbuffs["Crazy Blades"]) },
					{ name = "Leopard Instinct",                    use = (PctH("player") < .30)  },
					{ name = "Holy Shield",  						use = (PctH("player") < .15) },
					--{ name = "Action: 00 (HP pot)",          	    use = (phealth < 0.10) },
					{ name = "Threaten",							use = ((tbuffs["Holy Seals 3"]) and (not pbuffs["Threaten"]))},
					{ name = "Mana Return",							use = ((tbuffs["Holy Seals 3"]) and (pctEB1 <= 0.60))},
					--{ name = "Punishment",                     		use = (tbuffs["Light Seal III"]) },
					--{ name = "Whirlwind Shield",                    use = ((true) and (combat)) },
					{ name = "Dance of Two Blades",                 use = ((true) and (combat)) },
					{ name = "Holy Strike",                     	use = (true) },
						}
			elseif ((enemy) and (goat2 == "2")) then -- AoE
				Skill2 = {
					{ name = "Action: 10 (Arching Chop)",           use = (true) },
					{ name = "Dance of Two Blades",                 use = (true) },
					--{ name = "Whirlwind Shield",                    use = ((true) and (combat)) },
						}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		------------------
		-- KNIGHT/SCOUT --
		------------------
		elseif subClass == "RANGER" then			
			if (goat2 == "0") then -- Long bufs
				Skill = {
					{ name = "Enhanced Armor",						use = (not pbuffs["Enhanced Armor"]) },
					{ name = "ItemID: 207200",		use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
					    }
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- instant skilovi
				Skill2 = {
				    { name = "Throat Attack",                       use = (silenceThis) },
					--{ name = "Shock",                               use = (silenceThis) }, -- nisam siguran treba prbati
					{ name = "Charge",                              use = (silenceThis) },
					{ name = "Enhanced Armor",						use = ((not pbuffs["Enhanced Armor"]) or (pbuffs["Enhanced Armor"].time <= 45)) },
					{ name = "Hall of Dead Heroes",                 use = (PctH("player") < .30)  },
					{ name = "Holy Shield",  						use = (PctH("player") < .15) },
					{ name = "Shield of Valor",                     use = (PctH("player") < .50)  },
					{ name = "Holy Power Explosion",                use = ((true) and (boss)) },
					{ name = "Threaten",                            use = (boss and ((tbuffs[500169]) and (not pbuffs["Threaten"])))},
					{ name = "Whirlwind Shield",                    use = ((true) and (combat)) },
					{ name = "Truth Shield Bash",                   use = ((true) and (boss)) },
					{ name = "Holy Strike",                     	use = (true) },
						}
			elseif ((enemy) and (goat2 == "aoe")) then -- AoE
				Skill2 = {
					{ name = "Action: 10 (Arching Chop)",           use = ((true) and (combat)) },
					{ name = "Whirlwind Shield",                    use = ((true) and (combat)) },
					--{ name = "Holy Power Explosion",                use = ((true) and (boss)) }, -- nisam siguran za ideju
					{ name = "Holy Strike",                     	use = (true) },
						}
			elseif (goat2 == "2") then -- range
				Skill2 = {
				    { name = "Vampire Arrows",                    	use = (EnergyBar2 >= 20) },
					{ name = "Sacred Resistance",                   use = (true) },
					{ name = "Shot",                              	use = (true) },
                        }
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}		
			end	
		-----------------
		-- KNIGHT/MAGE --
		-----------------
		elseif subClass == "MAGE" then
			if (goat2 == "0") then --buffovi
				Skill = {
				    { name = "ID: 490152",   use = (not pbuffs[500141]) },                                  -- Enhanced Armor
					{ name = "ID: 490034",   use = (not pbuffs[502105]) },                                  -- Light Energy Weapon
					{ name = "ItemID: 207200",		use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
					    }
			--[[elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}--]]
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "3")) then -- instant skilovi 2h wpn
				Skill2 = {
				    { name = "ID: 490150",   use = (silenceThis) },                                         -- Charge
					{ name = "ID: 490296",	 use = (silenceThis) },								        	-- Silence
					{ name = "ID: 490152",   use = (not pbuffs[500141]) },                                  -- Enhanced Armor
					{ name = "ID: 490034",   use = (not pbuffs[502105]) },                                  -- Light Energy Weapon
					{ name = "ID: 491640",   use = (not pbuffs[500674]) },                                  -- Holy Protection
					{ name = "ID: 495724",   use = (PctH("player") < .30)  },                               -- Hall of Dead Heroes
					{ name = "ID: 490495", 	 use = (PctH("player") < .15) },                                -- Holy Shield
					{ name = "ID: 490085",   use = (PctH("player") < .50)  },                               -- Shield of Valor
					{ name = "ID: 490078",   use = (true) },                                                -- War Prayer
					{ name = "ID: 491628",   use = ((true) and (not pbuffs[500290])) },                     -- Holy Light Domain
					{ name = "ID: 490148",   use = (true) },                                                -- Holy Strike
					{ name = "ID: 540000",   use = (true) },							     				-- Attack
					    }	
			elseif ((enemy) and (goat2 == "1")) then -- instant skilovi 1h wpn
				Skill2 = {
				    { name = "ID: 490150",   use = (silenceThis) },                                         -- Charge
                   	{ name = "ID: 490296",	 use = (silenceThis) },								        	-- Silence
                    { name = "ID: 490152",   use = (not pbuffs[500141]) },                                  -- Enhanced Armor
					{ name = "ID: 490034",   use = (not pbuffs[502105]) },                                  -- Light Energy Weapon 
                    { name = "ID: 491640",   use = (not pbuffs[500674]) },                                  -- Holy Protection
                    { name = "ID: 495724",   use = (PctH("player") < .30)  },                               -- Hall of Dead Heroes
                    { name = "ID: 490495", 	 use = (PctH("player") < .15) },                                -- Holy Shield					
				    { name = "ID: 490085",   use = (PctH("player") < .50)  },                               -- Shield of Valor
					{ name = "ID: 490172",   use = ((true) and (boss)) },                                   -- Holy Power Explosion
					{ name = "ID: 490176",   use = ((true) and (combat)) },                                 -- Whirlwind Shield
					{ name = "ID: 490153",   use = (boss and ((tbuffs[500169]) and (not pbuffs[500246])))}, -- Threaten
					{ name = "ID: 490186",   use = ((true) and (boss)) },                                   -- Truth Shield Bash
					{ name = "ID: 490148",   use = (true) },                                                -- Holy Strike
					{ name = "ID: 491628",   use = ((true) and (not pbuffs[500290])) },                     -- Holy Light Domain
					{ name = "ID: 540000",   use = (true) },							     				-- Attack
					    }
			elseif ((enemy) and (goat2 == "2")) then
				Skill2 = {
				    { name = "ID: 490176",   use = ((true) and (combat)) },                                 -- Whirlwind Shield
					{ name = "Action: 10",   use = ((true) and (combat)) },                                 -- Ithem Set Skill 65 Grafu Castle
					{ name = "ID: 491628",   use = ((true) and (not pbuffs[500290])) },                     -- Holy Light Domain
					{ name = "ID: 490148",   use = (true) },                                                -- Holy Strike
				        }
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}		
			end		
		------------------
		-- KNIGHT/DRUID --
		------------------
		elseif subClass == "DRUID" then
			if (goat2 == "0") then -- Long bufs
				Skill = {
					{ name = "Enhanced Armor",						use = (not pbuffs["Enhanced Armor"]) },
					{ name = "ItemID: 207200",		use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
						}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- Main DPS combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		-------------------
		-- KNIGHT/PRIEST -- 06.10.2013
		-------------------
		elseif subClass == "AUGUR" then
			if (goat2 == "0") then --buffovi
				Skill = {
				    { name = "ID: 490152",   use = (not pbuffs[500141]) },                                  -- Enhanced Armor
					{ name = "ID: 491640",   use = (not pbuffs[500674]) },                                  -- Holy Protection
					{ name = "ID: 491166",   use = (not pbuffs[500548]) },                                  -- Magic Barrier
					{ name = "ItemID: 207200",	use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206", 	use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
					    }
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- instant skilovi
				Skill2 = {
				    { name = "ID: 490150",   use = (silenceThis) },                                         -- Charge
					{ name = "ID: 490154",   use = (silenceThis) },                                         -- Shock
				    { name = "ID: 490152",   use = (not pbuffs[500141]) },                                  -- Enhanced Armor
					{ name = "ID: 491640",   use = (not pbuffs[500674]) },                                  -- Holy Protection
					{ name = "ID: 491166",   use = (not pbuffs[500548]) },                                  -- Magic Barrier
					{ name = "ID: 495724",   use = (PctH("player") < .30)  },                               -- Hall of Dead Heroes
					{ name = "ID: 490495", 	 use = (PctH("player") < .15) },                                -- Holy Shield
					{ name = "ID: 490085",   use = (PctH("player") < .50)  },                               -- Shield of Valor
					{ name = "ID: 490172",   use = ((true) and (boss)) },                                   -- Holy Power Explosion
					{ name = "ID: 490176",   use = ((true) and (combat)) },                                 -- Whirlwind Shield
					{ name = "ID: 490153",   use = (boss and ((tbuffs[500169]) and (not pbuffs[500246])))}, -- Threaten
					{ name = "ID: 490186",   use = ((true) and (boss)) },                                   -- Truth Shield Bash
					--{ name = "ID: 490149",   use = ((true) and (boss)) },                                   -- Holy Seal
					{ name = "ID: 490148",   use = (true) },                                                -- Holy Strike
					    }
			elseif ((enemy) and (goat2 == "2")) then
				Skill2 = {
				    { name = "ID: 490176",   use = ((true) and (combat)) },                                 -- Whirlwind Shield
					{ name = "Action: 10",   use = ((true) and (combat)) },                                 -- Ithem Set Skill 65 Grafu Castle
					{ name = "ID: 490148",   use = (true) },                                                -- Holy Strike
					     }
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		-------------------
		-- KNIGHT/WARDEN --
		-------------------
		elseif subClass == "WARDEN" then
			if (goat2 == "0") then --buffovi
				Skill = {
					{ name = "Enhanced Armor",	use = (not pbuffs["Enhanced Armor"]) },
					{ name = "Briar Shield",	use = (not pbuffs["Briar Shield"]) },
					{ name = "ItemID: 207200",	use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206",	use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
						}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- instant skilovi
				Skill2 = {
					{ name = "Enhanced Armor",						use = (not pbuffs["Enhanced Armor"]) },
					{ name = "Briar Shield",                        use = (not pbuffs["Briar Shield"]) },
					{ name = "Hall of Dead Heroes",                 use = (PctH("player") < .30)  },
					{ name = "Holy Shield",  						use = (PctH("player") < .15) },
					{ name = "Action: 00 (HP pot)",          	    use = (phealth < 0.10) },
					{ name = "Action: 70 (40% Mana)",   			use = (pctEB1 < 0.08) },
					{ name = "Threaten",							use = ((tbuffs["Holy Seals 3"]) and (not pbuffs["Threaten"]))},
					{ name = "Mana Return",							use = ((tbuffs["Holy Seals 3"]) and (pctEB1 <= 0.60))},
					--{ name = "Punishment",                     		use = (tbuffs["Light Seal III"]) },
					{ name = "Whirlwind Shield",                    use = ((true) and (combat)) },
					{ name = "Holy Strike",                     	use = (true) },
						}
			elseif ((enemy) and (goat2 == "2")) then
				Skill2 = {
					{ name = "Action: 10 (Arching Chop)",           use = (true) },
					{ name = "Whirlwind Shield",                    use = ((true) and (combat)) },
					{ name = "Power of the Wood Spirit",            use = (true) },
						 }
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		--------------------
		-- KNIGHT/WARRIOR --05.09.2013
		--------------------
		elseif subClass == "WARRIOR" then
			if (goat2 == "0") then --buffovi
				Skill = {
					{ name = "ID: 490152",   		use = (not pbuffs[500141]) },                                  --Enhanced Armor
					{ name = "ItemID: 207200",		use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
					{ name = "Item: Hero Potion",	use = ((not pbuffs[501337]) and CE.HaveItem(200277)) },	-- Hero Potion
						}
			elseif (goat2 == "3") then -- buffovi pre boss-a
				Skill = {
				    { name = "ID: 490152",     use = (not pbuffs[500141]) },                                -- Enhanced Armor
				    { name = "ItemID: 207211", use = ((not pbuffs[506675]) and CE.HaveItem(207211)) },      -- Housekeeper Special Caviar Sandwich
					{ name = "ID: 490168",     use = (true) },                                              -- Resolution
					{ name = "ID: 490064", 	   use = ((PctH("player") < .45) and (EnergyBar2 >= 20)) },     -- Quick Reflexes
					{ name = "ID: 490088",     use = ((true) and (EnergyBar2 >= 10)) },                     -- Fearless
					{ name = "ItemID: 200173", use = ((not pbuffs[501321]) and CE.HaveItem(200173)) },      -- Strong Stimulant
					{ name = "ID: 490172",     use = ((true) and (boss)) },                                 -- Holy Power Explosion
					{ name = "ID: 495724",     use = (PctH("player") < .30)  },                             -- Hall of Dead Heroes
					{ name = "ID: 491321",     use = (true) },                                              -- Holy Strength
					{ name = "ID: 490492",     use = (combat and (EnergyBar2 < 50)) },                      -- Enraged
					{ name = "ID: 490150",     use = (true) },                                              -- Charge
					{ name = "ID: 490176",     use = ((true) and (combat)) },                               -- Whirlwind Shield
					{ name = "ID: 490148",     use = (true) },                                              -- Holy Strike
					    }
			--[[elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}--]]
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
				
			if ((enemy) and (goat2 == "1")) then -- instant skilovi
				Skill2 = {
				    { name = "ID: 490150",   use = (silenceThis) },                                         -- Charge
					{ name = "ID: 490154",   use = (silenceThis) },                                         -- Shock
					{ name = "ID: 490152",   use = (not pbuffs[500141]) },                                  -- Enhanced Armor
					{ name = "ID: 492935",   use = ((PctH("player") < .30) and (EnergyBar2 >= 30)) },       -- Master of Parry
					{ name = "ID: 495724",   use = (PctH("player") < .30)  },                               -- Hall of Dead Heroes
					--{ name = "ID: 490492",   use = (combat and (EnergyBar2 < 50)) },                        -- Enraged
					{ name = "ID: 490064", 	 use = ((PctH("player") < .45) and (EnergyBar2 >= 20)) },       -- Quick Reflexes
					{ name = "ID: 490495", 	 use = (PctH("player") < .15) },                                -- Holy Shield
					{ name = "ID: 490085",   use = (PctH("player") < .50)  },                               -- Shield of Valor
					{ name = "ID: 490172",   use = ((true) and (boss)) },                                   -- Holy Power Explosion
					{ name = "ID: 490153",   use = (boss and ((tbuffs[500169]) and (not pbuffs[500246])))}, -- Threaten
					{ name = "ID: 490018",   use = (boss and(EnergyBar2 >= 10) and (not tbuffs[502112])) }, -- Authoritative Deterrence
					{ name = "ID: 490176",   use = ((true) and (combat)) },                                 -- Whirlwind Shield
					{ name = "ID: 490186",   use = ((true) and (boss)) },                                   -- Truth Shield Bash
					--{ name = "ID: 490149",   use = ((true) and (boss)) },                                   -- Holy Seal
					{ name = "ID: 490148",   use = (true) },                                                -- Holy Strike
						 }
			elseif ((enemy) and (goat2 == "2")) then	
                Skill2 = {
                    { name = "ID: 490176",   use = ((true) and (combat)) },                                 -- Whirlwind Shield
					{ name = "ID: 492356",   use = ((combat) and(EnergyBar2 >= 40)) },                      -- Whirlwind
                    { name = "Action: 10",   use = ((true) and (combat)) },                                 -- Ithem Set Skill 65 Grafu Castle
                    { name = "ID: 490148",   use = (true) },                                                -- Holy Strike
                         }					
			elseif ((enemy) and (goat2 == "pvp")) then
				Skill2 = {
				    { name = "ID: 490085",   use = (PctH("player") < .50)  },                               -- Shield of Valor
				    { name = "ID: 490064", 	 use = ((PctH("player") < .45) and (EnergyBar2 >= 20)) },       -- Quick Reflexes
					{ name = "ID: 492935",   use = ((PctH("player") < .30) and (EnergyBar2 >= 30)) },       -- Master of Parry
					{ name = "ID: 490495", 	 use = (PctH("player") < .15) },                                -- Holy Shield
				    { name = "ID: 490150",   use = (true) },                                                -- Charge
					{ name = "ID: 490154",   use = ((true) and (not tbuffs[500243])) },                     -- Shock
					{ name = "ID: 490179",   use = ((true) and (not tbuffs[500243]) or (not tbuffs[500259])) }, -- Strike of Punishment
					{ name = "ID: 490186",   use = ((true) and (boss)) },                                   -- Truth Shield Bash
					{ name = "ID: 490148",   use = (true) },                                                -- Holy Strike
					     }
			end
		---------------------
		-- KNIGHT/CHAMPION --
		---------------------
		elseif subClass == "PSYRON" then
			if (goat2 == "0") then -- Long bufs
				Skill = {
					{ name = "Enhanced Armor",						use = (not pbuffs["Enhanced Armor"]) },
					{ name = "ItemID: 207200",		use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
						}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- Main DPS combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		--------------------
		-- KNIGHT/WARLOCK --
		--------------------
		elseif subClass == "HARPSYN" then
			if (goat2 == "0") then -- Long bufs
				Skill = {
					{ name = "Enhanced Armor",						use = (not pbuffs["Enhanced Armor"]) },
					{ name = "ItemID: 207200",		use = not pbuffs[506684] and CE.HaveItem(207200) and CE.ItemCD(207200)},	-- Unbridled Enthusiasm
					{ name = "ItemID: 207206", 		use = not pbuffs[506690] and CE.HaveItem(207206) and CE.ItemCD(207206)},	-- Scarlet Love
						}
			elseif goat2 == "3" then -- Burst boss buff's
				Skill = {
					{ name = "Func: CE.Item("..Sigil..")",	use = Sigil_Use and CE.HaveItem(Sigil) and Sigil_Check and CE.ItemCD(Sigil)},	-- Sigil
					{ name = "ItemID: "..CritFood,	use = CritFood_Use and CE.HaveItem(CritFood) and CritFood_Check and CE.ItemCD(CritFood)},	-- Critical hit food
					{ name = "ItemID: "..SpeedPot,	use = SpeedPot_Use and CE.HaveItem(SpeedPot) and SpeedPot_Check and CE.ItemCD(SpeedPot)},	-- Cast or Attack speed pot
					{ name = "ItemID: "..CritPot,	use = CritPot_Use and CE.HaveItem(CritPot) and CritPot_Check and CE.ItemCD(CritPot) },		-- Critical hit pot
						}
			elseif goat2 == "4" then -- Food and potions
				Skill = {
					{ name = "ItemID: "..HpDef,			use = HpDef_Use and CE.HaveItem(HpDef) and HpDef_Check and CE.ItemCD(HpDef) },			-- Hp or Defense food
					{ name = "ItemID: "..DmgFood, 		use = DmgFood_Use and CE.HaveItem(DmgFood) and DmgFood_Check and CE.ItemCD(DmgFood) },	-- Attack or damage food
					{ name = "ItemID: 200277",			use = Hero_Use and CE.HaveItem(200277) and Hero and CE.ItemCD(200277) },		-- Hero potion
					{ name = "ItemID: 202242",			use = Realgar_Use and CE.HaveItem(202242) and Realgar and CE.ItemCD(202242) },	-- Aged Realgar Wine
					{ name = "Func: CE.ISFood()",		use = ISFood_Use and CE.HaveItem(ISFood) and ISFood_Check and CE.ItemCD(ISFood) },	-- ItemShop Hp/Def Food
						}
			end
			
			if ((enemy) and (goat2 == "1")) then -- Main DPS combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "2")) then -- Ranged or instant skils combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			elseif ((enemy) and (goat2 == "pvp")) then -- PVP combo
				Skill2 = {{ name = "Func: CE.NoCode()",	use = (true) }}
			end
		end
	end
    --End Player Skill Sequences
    if (not MyCombat(Skill, arg1)) then
        MyCombat(Skill2, arg1)
    end
end
